combobox: Handle NULLing the cellview on remove simpler
authorBenjamin Otte <otte@redhat.com>
Wed, 29 Jul 2015 20:25:52 +0000 (22:25 +0200)
committerBenjamin Otte <otte@redhat.com>
Fri, 31 Jul 2015 02:03:44 +0000 (04:03 +0200)
gtk/gtkcombobox.c

index 3c79f912e7067f7a594af6e533ef742ce7bb6afb..0f77a2dd41178ab0a042751a12feb40d8c4751a9 100644 (file)
@@ -1556,18 +1556,12 @@ gtk_combo_box_add (GtkContainer *container,
       gtk_widget_unparent (priv->cell_view);
       _gtk_bin_set_child (GTK_BIN (container), NULL);
       gtk_widget_queue_resize (GTK_WIDGET (container));
+      priv->cell_view = NULL;
     }
   
   gtk_widget_set_parent (widget, GTK_WIDGET (container));
   _gtk_bin_set_child (GTK_BIN (container), widget);
 
-  if (priv->cell_view &&
-      widget != priv->cell_view)
-    {
-      /* since the cell_view was unparented, it's gone now */
-      priv->cell_view = NULL;
-    }
-
   if (priv->has_entry)
     {
       /* this flag is a hack to tell the entry to fill its allocation.